<template>
	<view class="video">
		<slot></slot>
		<scroll-view scroll-x>
			<view class="video-content">
				<view class="video-content-item" v-for="item in videoData" :key='item._id'>
					<navigator :url="'/pages/detail/detail?_id='+item._id" class="video-content-item">
						<video  :src="item.vid" @error="videoErrorCallback" enable-danmu danmu-btn controls></video>
						<!-- <image :src="item.coverpic"></image> -->
						<text>{{item.name}}</text>
						<view class="bottom">
							<view class="box">
								<text>{{item.pageview}}.0W</text>
								<image src="@/static/image/index/like/mengbanzu278.png"></image>
							</view>
							<view class="box">
								<text>{{Math.abs(item.collections)}}</text>
								<image src="@/static/image/index/like/mengbanzu279(1).png"></image>
							</view>
						</view>
					</navigator>

				</view>
			</view>
		</scroll-view>

	</view>
</template>

<script>
	export default {
		name: 'videoItem',
		data() {
			return {}
		},
		props: ['videoData'],
		onLoad() {
			this.videoData
		}
	}
</script>

<style lang="scss" scoped>
	.video {

		.video-content {
			width: 100vw;
			display: flex;

			.video-content-item {
				width: 316rpx;
				height: 324rpx;
				// background-color: #fffef3;
				margin-right: 20rpx;

				video {
					width: 316rpx;
					height: 220rpx;
					border-radius: 8rpx;

				}

				>text {
					font-size: 26rpx;
					font-weight: bold;
				}

				>.bottom {
					display: flex;

					.box {
						margin-right: 58rpx;

						text {
							font-size: 22rpx;
							margin-right: 10rpx;
							color: #aaa;

						}

						image {
							width: 28rpx;
							height: 22rpx;
						}
					}
				}
			}
		}

	}
</style>
